﻿@model WhiteGloss.Models.Artist

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Edit", "Artists", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Artist</legend>

        @Html.HiddenFor(model => model.ArtistId)
        @Html.HiddenFor(model => model.CreatedDate)
        @Html.HiddenFor(model => model.BioImage)
        @Html.HiddenFor(model => model.HomePageImage)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Bio)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Bio, new { style = "width: 500px; height: 100px" })
            @Html.ValidationMessageFor(model => model.Bio)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.BioImage)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.BioImage)
            @Html.ValidationMessageFor(model => model.BioImage)
            <br />
            <img src="@Model.BioImage" width="160" height="90" />
        </div>

        <div class="editor-label">
            Upload New Bio Image
        </div>

        <input id="fileUpload1" name="files" type="file" />

        <div class="editor-label">
            @Html.LabelFor(model => model.HomePageImage)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.HomePageImage)
            @Html.ValidationMessageFor(model => model.HomePageImage)
            <br />
            <img src="@Model.HomePageImage" width="160" height="90" />
        </div>

        <div class="editor-label">
            Upload New HomePage Image
        </div>

        <input id="fileUpload2" name="files" type="file" />

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
